package com.dp.vo;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "news_templatefield")
public class NewsTemplatefield implements Serializable {
	    private static final long serialVersionUID = 1L;
	    @Id
	    @GeneratedValue(strategy = GenerationType.IDENTITY)
	    @Basic(optional = false)
	    @Column(name = "id")
	    private Integer id;
	    @JoinColumn(name = "templateid", referencedColumnName = "id")   
		@ManyToOne
	    private NewsTemplate template;
	    @Column(name = "templatefieldname")
	    private String templatefieldname;
	    @Column(name = "templatefieldkey")
	    private String templatefieldkey;
	    @Column(name = "ttype")
	    private Integer ttype;
	    @Column(name = "torder")
	    private Integer torder;
	    
	    public NewsTemplatefield(){
	    	
	    }
	    public NewsTemplatefield(Integer id){
	    	this.id=id;
	    }
	    
	    
		public Integer getId() {
			return id;
		}
		public void setId(Integer id) {
			this.id = id;
		}
		public NewsTemplate getTemplate() {
			return template;
		}
		public void setTemplate(NewsTemplate template) {
			this.template = template;
		}
		public String getTemplatefieldname() {
			return templatefieldname;
		}
		public void setTemplatefieldname(String templatefieldname) {
			this.templatefieldname = templatefieldname;
		}
		public String getTemplatefieldkey() {
			return templatefieldkey;
		}
		public void setTemplatefieldkey(String templatefieldkey) {
			this.templatefieldkey = templatefieldkey;
		}
		public Integer getTtype() {
			return ttype;
		}
		public void setTtype(Integer ttype) {
			this.ttype = ttype;
		}
		public Integer getTorder() {
			return torder;
		}
		public void setTorder(Integer torder) {
			this.torder = torder;
		}
		
		
		@Override
	    public int hashCode() {
	        int hash = 0;
	        hash += (id != null ? id.hashCode() : 0);
	        return hash;
	    }

	    @Override
	    public boolean equals(Object object) {
	        if (!(object instanceof NewsTemplatefield)) {
	            return false;
	        }
	        NewsTemplatefield other = (NewsTemplatefield) object;
	        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
	            return false;
	        }
	        return true;
	    }

	    @Override
	    public String toString() {
	        return "com.dp.vo.NewsTemplatefield[id=" + id + "]";
	    }
}
